
public class Punkt3D implements Comparable<Punkt3D> {

	private Double x,y,z;
	
	public Punkt3D(double x, double y,  double z){
		this.x = x;
		this.y = y;
		this.z = z;
	}
	/**
	 * Sortierung anhand der x, y, z Koordinate
	 */
	
	@Override
	public int compareTo(Punkt3D arg0) {
		int compareTo = this.x.compareTo(arg0.x);
		if(compareTo == 0) {
			compareTo = this.y.compareTo(arg0.y);
			if(compareTo == 0){
				compareTo = this.z.compareTo(arg0.z);
			}
		
		}
		return compareTo;
	}
	
	@Override
	public String toString() {
		return this.getClass().getName() + " [x=" + x + ", y=" + y + ", z=" + z +"]";
		
	}
	
	

	@Override
	public boolean equals(Object arg0) {
		if(arg0== null)
			return false;
		
		if(arg0 == this)
			return true;
		
		if(!(arg0.getClass().equals(this.getClass()))) {
			return false;
		}
		
		Punkt3D ref = (Punkt3D) arg0;
		
		if(ref.x.equals(this.x) && ref.y.equals(this.y) && ref.z.equals(this.z)) {
			return true;
		}
		
		return false;
	}
	public Double getX() {
		return x;
	}

	public void setX(Double x) {
		this.x = x;
	}

	public Double getY() {
		return y;
	}

	public void setY(Double y) {
		this.y = y;
	}

	public Double getZ() {
		return z;
	}

	public void setZ(Double z) {
		this.z = z;
	}
	
	
}
